package com.ruoyi.system.vo;

import java.util.UUID;

public class StringUtilsss {

	public static String binaryToHexString(byte[] bytes) {
		StringBuffer sb = new StringBuffer();
		for (int i = 0; i < bytes.length; i++) {
			String hex = Integer.toHexString(bytes[i] & 0xFF);
			if (hex.length() == 1) {
				hex = '0' + hex;
			}
			sb.append(hex.toUpperCase());
		}
		return sb.toString();
	}

	public static String randomUUID() {
		UUID uuid = UUID.randomUUID();
		return uuid.toString().replace("-", "").toUpperCase();
	}

	public static String likeDepartmentCode(String departmentCode) {
		return departmentCode.replaceAll("(0000)*$", "");
	}

}